package xj.graph2d;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Stroke;

public interface DrawShapeConstants {

  // Hit test location
  public static final int HIGH_MASK = 0xFFFF0000;
  public static final int LOW_MASK  = 0x0000FFFF;

  public static final int PointOutside                 = 0x010000;
  public static final int PointInside                  = 0x020000;
  public static final int PointInBounds                = 0x1000000;
  public static final int PointOnEdge                  = 0x100000;
  public static final int PointNorthEdge               = 0x110000;
  public static final int PointSouthEdge               = 0x120000;
  public static final int PointEastEdge                = 0x130000;
  public static final int PointWestEdge                = 0x140000;
  public static final int PointOnCorner                = 0x200000;
  public static final int PointNECorner                = 0x210000;
  public static final int PointNWCorner                = 0x220000;
  public static final int PointSECorner                = 0x230000;
  public static final int PointSWCorner                = 0x240000;
  public static final int PointOnEnd                   = 0x250000;
  public static final int PointOnCircumference         = 0x300000;
  public static final int PointOnCurve                 = 0x310000;
  public static final int PointOnCurveEndPoint         = 0x320000;
  public static final int PointOnCurveCtrPoint         = 0x330000;
  public static final int PointOnPolyShapeVertex       = 0x400000;
  public static final int PointOnPolyShapeEdge         = 0x410000;
  public static final int PointOnPolyCurveCtrPoint     = 0x420000;
  public static final int PointOnStringBaselineStart   = 0x500000;
  public static final int PointOnStringBaselineEnd     = 0x510000;
  public static final int PointOnRotationHandle        = 0x520000;
  public static final int PointOnHorizontalDivider     = 0x600000;
  public static final int PointInHorizontalCompartment = 0x610000;
  public static final int PointOnVerticalDivider       = 0x620000;
  public static final int PointInVerticalCompartment   = 0x630000;
  public static final int PointOnIcon                  = 0x640000;
  public static final int PointOnMessage               = 0x650000;
  public static final int PointGraphEdgeSource         = 0x000000;
  public static final int PointGraphEdgeDestination    = 0x000001;

  // Hot spot

  public static final int HOTSPOT_SIZE = 20;
  public static final int HOTSPOT_NONE             = 0x0000;
  public static final int HOTSPOT_NODE_LABEL       = 0x0100;
  public static final int HOTSPOT_NODE_LABEL2      = 0x0101;
  public static final int HOTSPOT_NODE_LABEL3      = 0x0102;
  public static final int HOTSPOT_NODE_LABEL4      = 0x0104;
  public static final int HOTSPOT_NODE_LABEL5      = 0x0108;
  public static final int HOTSPOT_EDGE_LABEL       = 0x0200;
  public static final int HOTSPOT_EDGE_TAIL_LABEL  = 0x0201;
  public static final int HOTSPOT_EDGE_HEAD_LABEL  = 0x0202;
  public static final int HOTSPOT_EDGE_TAIL_LABEL2 = 0x0204;
  public static final int HOTSPOT_EDGE_HEAD_LABEL2 = 0x0208;

  // Clone mode

  public static final int NO_DRAW_ATTR              = 0x0;
  public static final int USE_SYSTEM_DRAW_ATTR      = 0x1;
  public static final int CLONE_SYSTEM_DRAW_ATTR    = 0x2;
  public static final int USE_PROTOTYPE_DRAW_ATTR   = 0x11;
  public static final int CLONE_PROTOTYPE_DRAW_ATTR = 0x12;

  // Scale mode
  public static final int SCALE_DEFAULT          = 0x0;
  public static final int SCALE_EXCLUDE_SUBSHAPE = 0x2;
  public static final int SCALE_EXCLUDE_GUTTER   = 0x4;

  // Drawing mode
  // used in DrawShapeBase.drawShape(g2, mode)

  public static final int DRAW_DEFAULT         = 0x0;
  public static final int DRAW_SELECTED        = 0x1;
  public static final int DRAW_PRINT           = 0x2;
  public static final int DRAW_OVER_HINT       = 0x10;
  public static final int DRAW_GRAPH_OVER_HINT = 0x11;
  public static final int DRAW_INSERTION_HINT  = 0x12;
  public static final int DRAW_HOTSPOT_HINT    = 0x13;
  public static final int DRAW_OUTLINE_FAST    = 0x100;
  public static final int DRAW_OUTLINE_REAL    = 0x101;

  // display mode for shapes containing text 

  public static final int NORMAL  = 0x0;
  public static final int POPUP   = 0x1;
  public static final int EDITING = 0x2;

  // Write mode

  public static final int WRITE_XML_DEFAULT  = 0;
  public static final int WRITE_XML_TEMPLATE = 1;

  // Roles

  public static final int ROLE_DEFAULT          = 0x0;
  public static final int ROLE_PLACEHOLDER      = 0x2000;
  public static final int ROLE_LABEL            = 0x1000;
  public static final int ROLE_NODE_TITLE_LABEL = 0x1100;
  public static final int ROLE_NODE_LABEL       = 0x1101;
  public static final int ROLE_NODE_LABEL2      = 0x1102;
  public static final int ROLE_NODE_LABEL3      = 0x1103;
  public static final int ROLE_NODE_LABEL4      = 0x1104;
  public static final int ROLE_NODE_LABEL5      = 0x1105;
  public static final int ROLE_NODE_TEMPLATE    = 0x1110;
  public static final int ROLE_EDGE_LABEL       = 0x1200;
  public static final int ROLE_EDGE_TAIL_LABEL  = 0x1201;
  public static final int ROLE_EDGE_TAIL_LABEL2 = 0x1202;
  public static final int ROLE_EDGE_HEAD_LABEL  = 0x1203;
  public static final int ROLE_EDGE_HEAD_LABEL2 = 0x1204;

  public static final int ROLE_DOCUMENT_HEADER  = 0x2101;
  public static final int ROLE_DOCUMENT_FOOTER  = 0x2102;

  public static final int[] NODE_LABEL_ROLES = { 
    ROLE_LABEL, 
    ROLE_NODE_LABEL,
    ROLE_NODE_TITLE_LABEL, 
    ROLE_NODE_LABEL2, 
    ROLE_NODE_LABEL3,
    ROLE_NODE_LABEL4, 
    ROLE_NODE_LABEL5,
  };

  public static final int[] EDGE_LABEL_ROLES = { 
    ROLE_LABEL, 
    ROLE_EDGE_LABEL,
    ROLE_EDGE_TAIL_LABEL, 
    ROLE_EDGE_TAIL_LABEL2, 
    ROLE_EDGE_HEAD_LABEL,
    ROLE_EDGE_HEAD_LABEL2
  };

  // Flags

  public static final int FLAG_FIXED_ON_EDGE = 0x0001;

  // Dimension and length

  public static final float d = 2.0f; // cusion surrounding the shape

  public static final int framePad = 5;

  public static final int handleLength = 20;

  public static final int COMPARTMENT_ROLE_BASE = 0;

  public static final int cpadx = 5;

  public static final int cpady = 5;

  public static final float ANGLE_360 = (float) (Math.PI * 2);

  public static final float ANGLE_90 = (float) (Math.PI / 2);

  // Default colors and strokes

  public static final Color shadeColor = new Color(168, 168, 168, 128);

  public static final Color anchorColor = new Color(255, 0, 0, 128);

  public static final Color edgeSourceColor = new Color(0, 128, 0, 200);

  public static final Color edgeDestinationColor = new Color(128, 0, 0, 200);

  public static final Color defaultFrameColor = new Color(0, 0, 128, 128);

  public static final boolean frameMarkFilled = false;

  public static final Color debugFrameColor1 = new Color(0, 128, 128, 128);
  public static final Color debugFrameColor2 = new Color(128, 0, 128, 128);

  public static final Stroke ctrStroke = 
    new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 10.0f,
		    new float[] { 3, 3 }, 0);

  public static final Stroke markStroke = 
    new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER);

  // protected Color cursorcolor = Color.yellow;
  public static final Color cursorcolor = new Color(0x80, 0x80, 0x80, 128);
  public static final Stroke groupStroke = 
    new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 10.0f,
		    new float[] { 2, 2 }, 0);

  public static final Color groupColor = new Color(255, 255, 200, 128);

  public static final Color overColor = new Color(200, 255, 200, 128);

  public static final Color overColorGraphNode = new Color(255, 200, 255, 128);

  public static final Color hotspotColor = new Color(255, 200, 200, 128);

  public static final Color insertionHintColor = new Color(200, 200, 155, 128);

  public static final Color waterMarkColor = new Color(200, 200, 200, 128);

}
